{% extends('layout.html') %}
{% block body %}
<div id="dev-modal" class="modal modal-pop">
    <div class="modal-content">
        {% if control %}
        <script>var error = true;</script>
        <h5 class="red-text">Are you sure you want to {{action}} the system?</h5>
        {% endif %}
    </div>
    <div class="row right">
        <div class="input-field col s5 m5">
            <form action="/device/{{action}}" method="POST">
                <button class="btn waves-effect waves-light">
                    <input type="hidden" name="system_{{action}}" value="YES">
                    <i class="material-icons">YES</i>
                </button>
            </form>
        </div>
        <div class="input-field col s5 m5">
            <form action="/device/{{action}}" method="POST">
                <button class="btn waves-effect waves-light">
                    <input type="hidden" name="system_{{action}}" value="NO">
                    <i class="material-icons">NO</i>
                </button>
            </form>
        </div>
    </div>
</div>
{% if confirmed %}
<section id="why-me" class="section">
    <div class="container">
        {% if action == 'restart' %}
        <h4 class="red-text">The system is now restarting. This can take a few minutes. </h4>
        {% elif action == 'shutdown' %}
        <h4 class="red-text">The system is being shutdown. Please wait a few minutes before unplugging the device from
            power. </h4>
        {% endif %}
    </div>
</section>
{% endif %}
{% endblock %}